package cc.yugu.yhdw.common.domain.basic;

import cc.yugu.yhdw.common.entity.json.DateTimeSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * 短信接口配置实体类
 *
 * @Date:Created in 2018/7/25 14:23
 * @Author:
 * @Modified By: zjn 2018/7/25 14:23
 */
public class SmsConfig extends SmsConfigInfo {

    Integer agentId;
    Integer smsType;  // 短信接口类型
    String configName; // 短信公司名称
    String account;  // 账号
    String password; // 密码
    Integer activeFlag; // 启用标识
    String sign; //短信签名
    Integer signPlace; //签名位置 左边 右边
    String balance;  // 余额
    Date updateTime; // 更新时间

    public enum Type {
        DXW(1, "短信网"),
        CLW(2, "创蓝网"),
        WND(3, "维纳多"),
        SWLH(4, "商务领航"),
        ALDY(5, "阿里大于"),
        YTX(6, "253云通讯")
        ;

        private final int value;
        private final String name;

        private Type(int value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<Integer, String> map = new HashMap<Integer, String>();
        static {
            for (Type e : Type.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum SignPlace {
        LEFT(1, "左边"),
        RIGHT(2, "右边"),
        ;

        private final int value;
        private final String name;

        private SignPlace(int value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<Integer, String> map = new HashMap<Integer, String>();
        static {
            for (Type e : Type.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public String getBalance() {
        return balance;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getAgentId() {
        return agentId;
    }

    public void setAgentId(Integer agentId) {
        this.agentId = agentId;
    }

    public Integer getSmsType() {
        return smsType;
    }

    public void setSmsType(Integer smsType) {
        this.smsType = smsType;
    }

    public String getConfigName() {
        return configName;
    }

    public void setConfigName(String configName) {
        this.configName = configName;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getActiveFlag() {
        return activeFlag;
    }

    public void setActiveFlag(Integer activeFlag) {
        this.activeFlag = activeFlag;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public Integer getSignPlace() {
        return signPlace;
    }

    public void setSignPlace(Integer signPlace) {
        this.signPlace = signPlace;
    }
}
